<div id="r_n_dPage">
    <div class="post">
        <h2 class="title">Research and Development</h2>
        <div class="entry">
            <script>
                $(function() {
                    $( "#lett_datepicker" ).datepicker({ dateFormat: 'yy-mm-dd' });
                });
                $(function() {
                    $( "#lett_datepicker2" ).datepicker({ dateFormat: 'yy-mm-dd' });
                });

            </script>

            <input type="button" value="Add new" onclick="show('#new_r_n_d')"/>
            <?php
            //if ($this->session->userdata("admin")) {
            ?>
                <input type="button" value="Search" onclick="show('#searchR_n_d')"/>
                <input type="button" value="Clear Search" onclick="clearSearch()"/>
            <?php
            //}
            ?>
            <div id="r_n_d_result" class="info">
                <?= $message ?>
            </div>
            <script type="text/javascript">
                function searchR_n_d(){
                    field=document.getElementById("searchR_n_dForm").field.value;
                    search=document.getElementById("searchR_n_dForm").search.value;
                    $("#r_n_dPage").load("<?= base_url(); ?>index.php?/admin_mis/r_n_d/"+field+"/"+search);
                }
                function clearSearch(){
                    $("#r_n_dPage").load("<?= base_url(); ?>index.php?/admin_mis/r_n_d/");
                }
            </script>




            <div id="r_n_d_result" style="display: none">
            </div>
            <!--a href="" id="hide3" >Hide</a> <a href="" id="show3" >Show</a-->
            <div id="new_r_n_d" style="display: none;margin-bottom: 10px;">
                <?php $data['id'] = "doc_form" ?>
                <?= form_open_multipart('mis/saveR_n_d', $data); ?>
                <table>
                    <tr class="darker"><td class="half">Title</td><td><input type="text" class="wide" name="title" value="<?php echo set_value('title'); ?>" /></td> </tr>
                    <tr class="lighter"><td class="half">Target</td><td><input type="text" class="wide" name="target" value="<?php echo set_value('target'); ?>" /></td> </tr>
                    <tr class="darker"><td class="half">Start date</td><td><input type="text" class="wide" name="start_date" value="<?php echo set_value('start_date'); ?>" id="lett_datepicker" /></td> </tr>
                    <tr class="lighter"><td class="half">End date</td><td><input type="text" class="wide" name="end_date" value="<?php echo set_value('end_date'); ?>" id="lett_datepicker2" /></td> </tr>
                    <tr class="darker"><td class="half">Cost</td><td><input type="text" class="wide" name="cost" value="<?php echo set_value('cost'); ?>"/></td> </tr>
                    <tr class="lighter"><td class="half">Tools</td><td><input type="text" class="wide" name="tools" value="<?php echo set_value('tools'); ?>"/></td> </tr>
                    <tr class="lighter"><td>Report</td><td><input type="file" class="wide"  name="userfile" /></td> </tr>
                    <tr><td colspan="2" style="text-align: right">
                            <input type="submit" value="Submit" />
                            <input type="button" value="Cancel" onclick="hide('#new_r_n_d')"/>
                        </td></tr>
                </table>
                </form>
            </div>
            <div id="searchR_n_d" style="display: none;margin-bottom: 10px;">
                <form id="searchR_n_dForm">
                    <table>
                        <tr class="darker"><td class="half">Select search criteria</td>
                            <td><select name="field">
                                    <option value='all'> All</option>
                                    <option value='title'>Title</option>
                                    <option value='target'>Target</option>
                                    <option value='tools'>Tools</option>
                                    <option value='added_by'>Added by</option>
                                </select></td>
                            <td><input type="text" name="search" class="wide"  value="<?php echo set_value('added_by'); ?>" /></td>
                        </tr>

                        <tr><td colspan="3" style="text-align: right">
                                <input type="button" value="Submit" onclick="searchR_n_d()" />
                                <input type="button" value="Cancel" onclick="hide('#searchR_n_d')"/>
                            </td></tr>

                    </table>
                </form>
            </div>
            <div id="all_docs">
                <?= $pagina ?>
                <?= $tablet ?>
                <?= $pagina ?>
            </div>

        </div>
    </div>
</div>